package com.mall.ums.interceptor;

import com.mall.model.domain.ums.Admin;

public class AdminHolder {
    private static ThreadLocal<Admin> threadLocal = new ThreadLocal<>();

    public static void set(Admin admin){
        threadLocal.set(admin);
    }

    public static Admin get(){

        Admin admin = threadLocal.get();
        return admin;
    }


    public static Long getAdminId(){
        Admin admin = threadLocal.get();
        return admin.getId();
    }

    public static void remove(){
        threadLocal.remove();
    }
}
